package com.mask.sca.system.service.impl;

import com.mask.sca.core.entity.RoleDTO;
import com.mask.sca.core.entity.UserDTO;
import com.mask.sca.system.service.UserService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author：jian
 * @Package：com.mask.sca.user.service.impl
 * @Project：mask-sca-cloud
 * @name：UserServiceImpl
 * @Date：2025/7/16 01:25
 * @Filename：UserServiceImpl
 */
@Service
public class UserServiceImpl implements UserService {
    @Override
    public UserDTO loadByUsernameAndTenantId(String username) {
        UserDTO userDTO = new UserDTO();
        userDTO.setId(1L);
        userDTO.setUsername("admin");
        userDTO.setPassword("$2a$10$PFrfJ6bdeJIs8xNOa44h9u8jYT7HBPO7l9eyT8dLrFjxeyqTUF5Ru");
        userDTO.setTenantId("1");
        userDTO.setEnabled(true);
        RoleDTO roleDTO = new RoleDTO();
        roleDTO.setId(1L);
        roleDTO.setTenantId("1");
        roleDTO.setRoleCode("ADMIN");
        roleDTO.setRoleName("管理员");
        List<RoleDTO> roles = new ArrayList<>();
        roles.add(roleDTO);
        userDTO.setRoles(roles);
        userDTO.setStatus(0);
        return userDTO;
    }
}
